package walletkey

import "navi-mumbai/common/key/gamekey"

// 数据库用户金额 乘以100 （系统配置除外 配置中费率是乘以100）
const MoneyScale = 100

// TODO 币种图标
const (
	BTC  = 100 // BTC
	USD  = 200 // USD
	INR  = 201 // INR // 印度卢比
	GOLD = 300 // 金币

	UsingCurrencyType = INR //B端使用的货币类型
)

func GetMoneyIcon(moneyType int64) string {
	switch moneyType {
	case BTC:
		return "btc.jpg"
	case USD:
		return "usd.jpg"
	case GOLD:
		return "gold_coin.svg"
	case INR:
		return "inr.jpg"
	default:
		return ""
	}
}

func GetMoneyNameByMoneyType(moneyType int64) string {
	switch moneyType {
	case BTC:
		return "BTC"
	case USD:
		return "USD"
	case GOLD:
		return "GOLD"
	case INR:
		return "INR"
	default:
		return ""
	}
}

// B转G
func GetGameCurrency(providerId int64, moneyType int64) string {
	switch providerId {
	case gamekey.ProviderIdY9Y:
		return GetMoneyNameByMoneyType(moneyType)
	default:
		return ""
	}
}

// G转B
func GetMoneyTypeFromGame(providerId int64, moneyName string) int64 {
	switch providerId {
	case gamekey.ProviderIdY9Y:
		return GetMoneyTypeByMoneyName(moneyName)
	default:
		return 0
	}
}

func GetMoneyTypeByMoneyName(moneyName string) int64 {
	switch moneyName {
	case "BTC":
		return BTC
	case "USD":
		return USD
	case "GOLD":
		return GOLD
	case "INR":
		return INR
	default:
		return 0
	}
}
